package brainsplash.gyrusscope.game;

import java.util.ArrayList;

import brainsplash.gyrusscope.framework.gl.TextureRegion;

import android.graphics.Bitmap;
import android.util.Log;

public class Spaceship extends BaseObject{
	public static final int numSpaceshipSprites = 2;
	public static final int[] blastDamages = {};
	public static final int[] blastRadius = {};
	public int health = 100;
	public int reload = 10;
	public int reloadCounter = 0;

	public Spaceship(TextureRegion sprite, int x, int y, int radius, float distanceFromCenter, float direction, float speed) {
		super(sprite, x, y, radius, distanceFromCenter, direction, speed);
	}

	public ArrayList<Blast> fire(int mode) {
		ArrayList<Blast> b = new ArrayList<Blast>();
		Assets.playSound(Assets.laserSound);
		switch(mode) {
			case 0: // 1 shot forward
				b.add(new Blast(Assets.blast, x, y, 10, distanceFromCenter, direction, speed+1, 5, this));
				break;
			case 1: // 3 shots forward
				b.add(new Blast(Assets.blast, x, y, 10, distanceFromCenter, direction - 10, speed+1, 5, this));
				b.add(new Blast(Assets.blast, x, y, 10, distanceFromCenter, direction, speed+1, 5, this));
				b.add(new Blast(Assets.blast, x, y, 10, distanceFromCenter, direction + 10, speed+1, 5, this));
				break;
			case 2: // 1 shot backward
				b.add(new Blast(Assets.blast, x, y, 10, distanceFromCenter, direction, -(speed+1), 5, this));
				break;
			case 3: // 2 shots forward
				b.add(new Blast(Assets.blast2, x, y, 10, distanceFromCenter, direction - 10, 2, 100, this));
				b.add(new Blast(Assets.blast2, x, y, 10, distanceFromCenter, direction + 10, 2, 100, this));
			default:
				break;
		}
		return b;
	}
}
